//============================================================================
// Name        : csiena
// Author      : Josh Lospinoso
// Copyright   : MIT License
// Description : Austere, limited implementation of the R package RSiena in
//				 C++. Used for fast maximum likelihood and method of moments
//				 estimation of stochastic actor oriented models (SAOMs)
//				 without any frills or user experience niceties.
//============================================================================

#ifndef DIGRAPH_H_
#define DIGRAPH_H_
#include "globals.h"

namespace csiena {

class Digraph {
public:
	// Initializers
	Digraph(int actors);
	virtual ~Digraph();
	Digraph(const Digraph &donorDigraph);

	// Accessors
	int getActors();
	bool get(int i, int j);
	bool set(int i, int j, bool xij);
	bool flip(int i, int j);

	// Convenience methods
	void print();
	void fixDiag();
	void copy(const Digraph& donor);
	void xCopy(bool *copy);
	void readNet(const char* fname);
	void writeNet(const char* fname);
private:
	int actors;
	bool* x;
	bool isInitialized;
};

}

#endif /* DIGRAPH_H_ */
